''' Mission 12 - Night Light Mild Solution The remix gives another level for the night light. If very bright - display a picture (like the house) If just below room light - display a picture (like the happy face) and use the night light math If dark - display a picture (like asleep) and set the pixels a light sleeping color and brightness ''' from codex import * from time import sleep # select a value slightly under the # room light readings ROOM = 5500 DARK = 1000 while True: value = light.read() if value < DARK: pixels.fill(CYAN, brightness = 5) display.show(pics.ASLEEP) elif value < ROOM: scaled = (1 - value / ROOM) * 20 level = int(scaled) pixels.fill(WHITE, brightness = level) display.show(pics.HAPPY) else: pixels.fill(BLACK) display.show(pics.HOUSE)